<h2>Students</h2>

<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Name</th><th>E-mail Address</th><th>Occupation</th><th>Pending</th><th>Registration Date</th></tr></thead><tbody>

<?php $i = 1;?>
<?php foreach($students->result() as $test){ ?>
		<tr><td><?php echo $test->lastname.",&nbsp".$test->firstname;?></td>
		<td><?php echo $test->email;?></td>
		<td><?php echo $test->occupation;?></td>
		<td><?php if($test->regstatus == "On Trial"){
				echo form_label('On Trial', 'regstatus'.$i);
			} else {
				echo form_label('Fully Paid', 'regstatus'.$i);
			}
		;?></td>
		<td><?php echo $test->regtime; ?></td></tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>

<br><br><br>
<?php echo form_open('admin/update_student_status'); ?>
<h3>Pending Students</h3>
<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Name</th><th>E-mail Address</th><th>Status</td></tr></thead><tbody>
<?php $i = 1;?>
<?php foreach($pending->result() as $test){ ?>
		<tr><td><?php echo $test->lastname.",&nbsp".$test->firstname; echo "<br>".'regstatus'.$i;?></td>
		<td><?php echo $test->email;?></td>
		<td><?php echo form_radio('regstatus'.$i, 'On Trial', $test->regstatus == 'On Trial' ? TRUE : FALSE) . 'Pending'; echo "&nbsp;&nbsp;";
	echo form_radio('regstatus'.$i, 'Fully Paid', $test->regstatus == 'Fully Paid' ? TRUE : FALSE) . 'Approve'; ?></td></tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>
<?php echo form_submit('update', 'Approve this student/s'); ?>
<?php echo form_close(); ?>
